package com.car.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.car.entity.Cartypetable;
import com.car.service.CartypetableService;

@Controller
@RequestMapping("Rent")
public class RentController {
	@Autowired
	CartypetableService cartypetableService;
	@RequestMapping("/index")
	public String  index(Model model){
		List<Cartypetable> cartypetable= cartypetableService.selectRentAll();
		model.addAttribute("rentlist", cartypetable );
		return "rent";
	}
	@RequestMapping("/updateRent")
	@ResponseBody
	public Object updateRent(Cartypetable car){
		int x = cartypetableService.updataRent(car);
		
		return x;
	}
	
}
